/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 *
 * @author Thai Ha Cong
 */
public class Order implements Serializable {
    private Integer idOrder;
    private Date createTime;
    private int totalQuantity;
    private double totalAmount;
    private String orderStatus;
    private String paypalTransactionId;
    private String paypalPaymentStatus;
    private String paypalReasonCode;
    private List<Orderitem> orderitemList;
    private Customer customer;

    public Order() {
    }

    public Order(Integer idOrder) {
        this.idOrder = idOrder;
    }

    public Order(Integer idOrder, Date createTime, int totalQuantity, double totalAmount, String orderStatus) {
        this.idOrder = idOrder;
        this.createTime = createTime;
        this.totalQuantity = totalQuantity;
        this.totalAmount = totalAmount;
        this.orderStatus = orderStatus;
    }
    public Order(Customer customer, Integer idOrder, Date createTime, int totalQuantity, double totalAmount, String orderStatus) {
        this.customer = customer;
        this.idOrder = idOrder;
        this.createTime = createTime;
        this.totalQuantity = totalQuantity;
        this.totalAmount = totalAmount;
        this.orderStatus = orderStatus;
    }

    public Order(Integer idOrder, Date createTime, int totalQuantity, double totalAmount, String orderStatus, String paypalTransactionId, String paypalPaymentStatus, String paypalReasonCode, List<Orderitem> orderitemList) {
        this.idOrder = idOrder;
        this.createTime = createTime;
        this.totalQuantity = totalQuantity;
        this.totalAmount = totalAmount;
        this.orderStatus = orderStatus;
        this.paypalTransactionId = paypalTransactionId;
        this.paypalPaymentStatus = paypalPaymentStatus;
        this.paypalReasonCode = paypalReasonCode;
        this.orderitemList = orderitemList;
    }

    public Integer getIdOrder() {
        return idOrder;
    }

    public void setIdOrder(Integer idOrder) {
        this.idOrder = idOrder;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public int getTotalQuantity() {
        return totalQuantity;
    }

    public void setTotalQuantity(int totalQuantity) {
        this.totalQuantity = totalQuantity;
    }

    public double getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(double totalAmount) {
        this.totalAmount = totalAmount;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    public List<Orderitem> getOrderitemList() {
        return orderitemList;
    }

    public void setOrderitemList(List<Orderitem> orderitemList) {
        this.orderitemList = orderitemList;
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    public String getPaypalTransactionId() {
        return paypalTransactionId;
    }

    public void setPaypalTransactionId(String paypalTransactionId) {
        this.paypalTransactionId = paypalTransactionId;
    }

    public String getPaypalPaymentStatus() {
        return paypalPaymentStatus;
    }

    public void setPaypalPaymentStatus(String paypalPaymentStatus) {
        this.paypalPaymentStatus = paypalPaymentStatus;
    }

    public String getPaypalReasonCode() {
        return paypalReasonCode;
    }

    public void setPaypalReasonCode(String paypalReasonCode) {
        this.paypalReasonCode = paypalReasonCode;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idOrder != null ? idOrder.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Order)) {
            return false;
        }
        Order other = (Order) object;
        if ((this.idOrder == null && other.idOrder != null) || (this.idOrder != null && !this.idOrder.equals(other.idOrder))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Order[ idOrder=" + idOrder + " ]";
    }
}
